/*
 * bplvisual.so
 *
 * TOpenDialog.h
 */


#ifndef __TOpenDialog_H__
#define __TOpenDialog_H__


#define __BplVisual_H_Inside__

#include <QDialogs.h>


namespace QDialogs {


class PACKAGE TOpenDialog : public QDialogs::TCustomDialog
{
    typedef QDialogs::TCustomDialog inherited;
    
__published:
    __property AnsiString DefaultExt = {read = FDefaultExt, write = FDefaultExt};
    __property WideString FileName = {read = FFileName, write = FFileName};
    __property AnsiString Filter = {read = FFilter, write = FFilter};
    __property int FilterIndex = {read = FFilterIndex, write = FFilterIndex, default = 1};
    __property AnsiString InitialDir = {read = FInitialDir, write = FInitialDir};
    __property TOpenOptions Options = {read = FOptions, write = FOptions, default = 640};
    
    __property OnClose ;
    //__property QForms::TCloseQueryEvent OnCanClose = {read = FOnCanClose, write = FOnCanClose};
    __property TFileAddEvent OnFileAdd = {read = FOnFileAdd, write = FOnFileAdd};
    //__property TFilePreviewEvent OnFilePreview = {read = FOnPreview, write = FOnPreview};
    __property TFilterChangeEvent OnFilterChange = {read = FOnFilterChange, write = FOnFilterChange};
    __property TDirChangeEvent OnFolderChange = {read = FOnFolderChange, write = FOnFolderChange};
    //__property TFileSelectedEvent OnSelected = {read = FOnSelected, write = FOnSelected};
    __property OnShow;
    
public:
    __fastcall TOpenDialog (Classes::TComponent * AOwner);
    __fastcall virtual ~TOpenDialog ();
    
    operator IOpenDialog*(void) { return (IOpenDialog*)&__IOpenDialog; }
    
    __property Classes::TStrings * Files = {read = FFiles};
    __property Classes::TStrings * HistoryList = {read = FHistoryList, write = SetHistoryList};
    
    virtual bool __fastcall Execute ();
    void __fastcall Refresh ();
    
protected:
    virtual void __fastcall CanClose(bool &CanClose);
    virtual TDialogForm * __fastcall CreateForm ();
    virtual void __fastcall DirChanged(WideString NewDir);
    virtual bool __fastcall DoExecute(void);
    virtual bool __fastcall FileAdd(const WideString Filename, const bool Readable, const bool Writeable, const bool Executable);
    // virtual void __fastcall FilePreview(const WideString Filename, Qgraphics::TCanvas* Canvas, const Types::TRect &Rect, Qgraphics::TProgressEvent Progress, bool &Handled);
    virtual void __fastcall FilterChanged(int Index);
    virtual void __fastcall RetrieveOptions(bool Accepted);
    virtual void __fastcall SetOptions(void);
    
private:
    AnsiString FDefaultExt;
    WideString FFileName;
    Classes::TStrings * FFiles;
    AnsiString FFilter;
    int FFilterIndex;
    Classes::TStrings* FHistoryList;
    AnsiString FInitialDir;
    TFileAddEvent FOnFileAdd;
    TFilterChangeEvent FOnFilterChange;
    TDirChangeEvent FOnFolderChange;
    TOpenOptions FOptions;
    bool FSaveDlg;
    AnsiString FSaveDir;
    
    void *__IOpenDialog;    /* QDialogs::IOpenDialog */
    
    void __fastcall SetHistoryList(Classes::TStrings* Value);
    void __fastcall SetSaveDlg(const bool Value);
};


}; // QDialogs


#undef __BplVisual_H_Inside__

#endif /* __TOpenDialog_H__ */
